package com.esri.core.symbol.advanced;

import android.graphics.Bitmap;
import com.esri.core.internal.util.d;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class SymbolProperties {
    private SymbolDictionaryImpl a;
    private String b;
    private ArrayList<String> c;
    private HashMap<String, String> d;

    /* JADX INFO: Access modifiers changed from: package-private */
    public SymbolProperties(String str, SymbolDictionaryImpl symbolDictionaryImpl) {
        this.b = str;
        this.a = symbolDictionaryImpl;
    }

    public String getName() {
        return this.b;
    }

    public List<String> getKeywords() {
        if (this.c == null) {
            try {
                a();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return this.c;
    }

    public Map<String, String> getValues() {
        if (this.d == null) {
            try {
                a();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
        return this.d;
    }

    public boolean getImage(Bitmap bitmap) {
        return this.a.a(this.b, bitmap);
    }

    public String toString() {
        return getName();
    }

    private void a() throws Exception {
        JsonParser c = d.c(this.a.a(this.b));
        if (c == null || !d.c(c)) {
            return;
        }
        while (c.nextToken() != JsonToken.END_OBJECT) {
            String currentName = c.getCurrentName();
            c.nextToken();
            if ("values".equals(currentName)) {
                if (c.getCurrentToken() == JsonToken.START_ARRAY) {
                    this.d = new HashMap<>();
                    while (c.nextToken() != JsonToken.END_ARRAY) {
                        if (c.getCurrentToken() == JsonToken.START_OBJECT) {
                            while (c.nextToken() != JsonToken.END_OBJECT) {
                                String currentName2 = c.getCurrentName();
                                c.nextToken();
                                this.d.put(currentName2, c.getText());
                            }
                        }
                    }
                }
            } else if ("keywords".equals(currentName)) {
                this.c = new ArrayList<>();
                for (String str : c.getText().split(";")) {
                    this.c.add(str);
                }
            } else {
                c.skipChildren();
            }
        }
        if (c.isClosed()) {
            return;
        }
        c.close();
    }
}
